<template>
  <van-row type="flex" :justify="align">
    <img :src="src" :style="getStyle" />
  </van-row>
</template>

<script>
export default {
  name: 'onlineCustomImage',
  props: {
    src: {
      type: String
    },
    fit: {
      type: String
    },
    align: {
      type: String,
      default: 'left'
    },
    width: {
      type: String
    },
    height: {
      type: String
    },
    radius: {
      type: String,
      default: '3px'
    },
    round: {
      type: Boolean,
      default: false
    },
    widget: {
      type: Object
    }
  },
  data () {
    return {
      fileList: []
    }
  },
  computed: {
    getStyle () {
      let temp = this.round ? '50%' : (this.radius + 'px');
      return {
        width: this.width != null ? this.width : '200px',
        height: this.height != null ? this.height : '200px',
        'object-fit': this.fit,
        'border-radius': temp
      }
    }
  }
}
</script>

<style>
</style>
